<template>
  <div>
    <div class="background-white">
      <div class="add-padding">
        <el-row class="reset-row">
          <el-col :span="3" :offset="2"><span style="color: #cc0000">*</span>客户姓名:</el-col>
          <el-col :span="8">
            <el-input
              placeholder="请输入客户姓名"
              v-model="editObj.customerName"
              clearable>
            </el-input>
          </el-col>
        </el-row>
        <el-row class="reset-row">
          <el-col :span="3" :offset="2"><span style="color: #cc0000">*</span>客户手机号:</el-col>
          <el-col :span="8">
            <el-input
              placeholder="请输入客户手机号"
              v-model="editObj.phone"
              clearable>
            </el-input>
          </el-col>
        </el-row>

        <el-row class="reset-row">
          <el-col :span="3" :offset="2"><span style="color: #cc0000">*</span>单位名称:</el-col>
          <el-col :span="8">
            <el-input
              placeholder="请输入单位名称"
              v-model="editObj.company"
              clearable>
            </el-input>
          </el-col>
        </el-row>
      </div>
      <div class="btn-action">
        <el-row>
          <el-col :span="6" :offset="5">
            <el-button type="danger" size="mini">保存</el-button>
            <el-button v-if="isEdit" size="mini" @click="deleteRow(1)">删除</el-button>
          </el-col>
        </el-row>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "update",
    props: {
      isEdit: {
        type: Boolean,
        default: false
      },
      isAdd: {
        type: Boolean,
        default: false
      },
      editObj: {
        type: Object,
        default: () => {
          return {};
        }
      }
    },
    data() {
      return {}
    },
    methods: {
      deleteRow(id) {
        this.$emit('deleteRow', {id: id})
      }
    }
  }
</script>

<style scoped lang="scss">
  /*  添加*/
  .add-padding {
    padding-top: 32px;
    border-bottom: 1px solid #f2f2f2;
  }

  .reset-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding-bottom: 16px;
  }

  .btn-action {
    padding-top: 16px;
    padding-bottom: 22px;
  }
</style>
